package cn.sunxyz.sample.aop;

import cn.sunxyz.aop.annotation.Aop;
import cn.sunxyz.aop.aspect.AbstractAdviceAspect;
import cn.sunxyz.common.utils.reflect.ClassUtil;

import java.lang.reflect.Method;

/**
 * Created by yangrd on 2017/5/26.
 */
//@Aop(pkg = "cn.sunxyz.sample.service", cls = "Service", sort = 2)
public class AdviceAspect2 extends AbstractAdviceAspect {

    @Override
    public void before(Object object, Method method, Object[] args) {
        System.out.println("AdviceAspect2 before=> " + ClassUtil.unwrapCglib(object)  + "#" + method.getName());
    }

    @Override
    public void after(Object object, Method method, Object[] args, Object result) {
        System.out.println("AdviceAspect2 after=> " + ClassUtil.unwrapCglib(object)  + "#" + method.getName());
    }
}
